/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ultrasoft.farmasoft.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Administrador
 */
@Embeddable
public class DefaultaccessPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "rolId")
    private int rolId;
    @Basic(optional = false)
    @Column(name = "menuId")
    private short menuId;
    @Basic(optional = false)
    @Column(name = "submenuId")
    private short submenuId;
    @Basic(optional = false)
    @Column(name = "optionId")
    private short optionId;

    public DefaultaccessPK() {
    }

    public DefaultaccessPK(int rolId, short menuId, short submenuId, short optionId) {
        this.rolId = rolId;
        this.menuId = menuId;
        this.submenuId = submenuId;
        this.optionId = optionId;
    }

    public int getRolId() {
        return rolId;
    }

    public void setRolId(int rolId) {
        this.rolId = rolId;
    }

    public short getMenuId() {
        return menuId;
    }

    public void setMenuId(short menuId) {
        this.menuId = menuId;
    }

    public short getSubmenuId() {
        return submenuId;
    }

    public void setSubmenuId(short submenuId) {
        this.submenuId = submenuId;
    }

    public short getOptionId() {
        return optionId;
    }

    public void setOptionId(short optionId) {
        this.optionId = optionId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) rolId;
        hash += (int) menuId;
        hash += (int) submenuId;
        hash += (int) optionId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DefaultaccessPK)) {
            return false;
        }
        DefaultaccessPK other = (DefaultaccessPK) object;
        if (this.rolId != other.rolId) {
            return false;
        }
        if (this.menuId != other.menuId) {
            return false;
        }
        if (this.submenuId != other.submenuId) {
            return false;
        }
        if (this.optionId != other.optionId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ultrasoft.farmasoft.domain.DefaultaccessPK[ rolId=" + rolId + ", menuId=" + menuId + ", submenuId=" + submenuId + ", optionId=" + optionId + " ]";
    }
    
}
